import { INS } from './Public.js';
export default class Node {
    [INS] = {};
    constructor({
        name,
        type = 'directory',
        ext = '',
        hash = '',
        time = new Date().getTime(),
        size = -1,
        data = null,
    }) {
        if (!name || /\\|\/|:|\*|\?|\"|<|>|\|/.test(name))
            throw new Error(`fileSystem: receive ${name}, name can not include  / : * ? " < > |`);
        switch (type) {
            case 'directory':
                this[INS] = { type, name };
                break;
            case 'file':
                this[INS] = { type, name, hash, time, size, ext, data };
                break;
        }
    }
}
